#coding:utf-8
from analysis.core.db import db

class dbHasUrl(db):
    def getRows(self,username):
        self.cursor.execute("select site,searchword,title,url,content,pubtime,fetchtime from "+self.table[6:]+" where searchword in (select keyword from keywords where username=%s) and url not in (select contenturl from "+self.table+" where username=%s) and site in (select url from monitorurl where type='"+self.type+"' and username=%s)",[username,username,username])
        return self.cursor.fetchall()